Why does my code not work out well replacing strings characters

welcome to shbcf.ru